package cn.cslg.action;
import cn.cslg.service.UserService;
import cn.cslg.service.impl.UserServiceImpl;

import java.sql.SQLException;

public class Login {

    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String login() throws SQLException {
        //调用service方法，完成数据库的校验
        UserService service = new UserServiceImpl();
        boolean flag = service.login(username,password);
        if(flag){
            return "success";
        }else{
            return  "error";
        }
    }
}
